﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace UnitLibrary.GameObjects.PowerUpEffects
{
    public class GodMode: PowerUpEffect
    {
        public GodMode()
        {
            base.Name = "godemode";
            base.UnitType = UnitID.Player;
            base.IsPermanent = false;
            base.Duration = 500;
        }
        public int Health = 15000;
        private int _originalHealth;
        public override void Create(object existingInstance, UnitLibrary.Managers.ComponentM components)
        {
            base.Create(existingInstance, components);
            this.Apply();
        }
        public override void Apply()
        {
            _originalHealth = _components.playerManager.Player.Health;
            _components.playerManager.Player.Health += this.Health;
            base.Apply();
        }
        public override void Remove()
        {
            _components.playerManager.Player.Health = _originalHealth;
            base.Remove();
        }
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            if (!IsEnabled)
                this.Remove();
        }
    }
}
